home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gawk / gawk213s.zoo / gawk-src-2.13 / mungeconf < prev    next >
Text File  |  1991-07-21  |  464b  |  21 lines

  1. #! /bin/sh
  2.  
  3. # stdout is normally config.h
  4.  
  5. case $# in
  6. 2)    ;;
  7. *)    echo "Usage: mungeconf sysfile distfile" >&2 ; exit 2 ;;
  8. esac
  9.  
  10. sed '/^#/d; /^MAKE_*/d' $1 |    # strip comments and Makefile stuff
  11. sed '1s:.*:s~__SYSTEM__~&~:
  12. 2,$s:^\([^     ]*\)[     ].*:s~^/\\* #define[     ]*\1.*~#define    &~:' >sedscr
  13.  
  14. sed -f sedscr $2
  15.  
  16. echo
  17. echo '/* anything that follows is for system-specific short-term kludges */'
  18. grep '^#define' $1        # for system-specific short-term kludges
  19.  
  20. rm -f sedscr
  21.